<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <p>
            <!-- 数据翻转 -->
            {{str.split('').reverse().join("")}}
        </p>
        <p>
            {{reverse}} {{reverse}} {{reverse}} {{reverse}} {{reverse}}
        </p>
        <p>{{mm}}</p>
        <button @click='clc'>按钮</button>
    </div>
    <script src="./vue.js"></script>
    <script>
        let vm = new Vue({
            el: "#app",
            data: {
                str: 'sunyufeng',
                mm: "lilili"
            },
            computed: {
                reverse() {
                    console.log('1111')
                    return this.str.split('').reverse().join("")
                }
            },
            methods: {
                clc() {
                    console.log(2222)
                    this.mm = this.mm.split('').reverse().join("")
                }
            }
        })
    </script>
</body>

</html>